package com.example.medicalretrieval.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;

import com.example.medicalretrieval.pojo.BrowsingHistory;
import com.example.medicalretrieval.pojo.DownloadHistory;

import java.util.Date;
import java.util.List;

@Dao
public interface DownloadHistoryDao {
    @Insert
    void insert(DownloadHistory downloadHistory);
    @Delete
    void delete(DownloadHistory downloadHistory);

    @Query("select * from downloadhistory order by 0+date DESC")
    List<DownloadHistory> queryByTimeOfDESC();

    @Query("update downloadhistory set date = :date where title = :title")
    void updateByTitle(String title, Date date);

    @Query("delete from downloadhistory where title=:title")
    void deleteByTitle(String title);

}
